Problem Statement

To create a web page using R Markdown that features a map created with Leaflet and host it on either GitHub Pages, RPubs, or NeoCities.

The Map

This is the map with all my favourite places in my home town. These were the places I visited when I was a child. Now I take my son to these places. Hope you will enjoy this.

library(plotly)
## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(tidyr)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
data("diamonds")
d <- diamonds[sample(nrow(diamonds), 1000), ]
mycolors = c('red','blue','green','brown','cyan')
#plot_ly(d,x = ~cut)
#plot_ly(d, y = ~price, x = ~carat,color = ~factor(cut), size = ~carat,colors = mycolors, text = ~paste("Price: ", price, '$<br>Cut:', cut))

plot_ly(d, y = ~price, x = ~carat,color = ~factor(cut), 
        colors = mycolors, 
        text = ~paste("Price: ", price, '$<br>Cut:', cut)
        ,mode = 'markers',marker = list(size = ~carat*5, opacity = 0.5)
        )
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plot.ly/r/reference/#scatter
data("mtcars")
d <- mtcars
mycolors = c('red','blue')
#d <- rename(d, c("0" = "Automatic", "1" = "Manual"))
plot_ly(d,y = ~mpg,x = ~wt, color = ~factor(am),
        text = ~paste("Cylinder: ",cyl),
        colors = 'Paired', mode = 'markers',marker = list(size = ~cyl*3, opacity = 0.5))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plot.ly/r/reference/#scatter